package com.jusda.util;

/**
 * @author:y022 24/04/2022 14:27
 * @description:
 */
public class ThreadLocalUtil {
//    public static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<Long>() {
//        protected Long initialValue(){
//            return System.currentTimeMillis();
//        }
//    };

    public static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<Long>();

    public static Long getValue() {
        return THREAD_LOCAL.get();
    }

    public static void setValue() {
        THREAD_LOCAL.set(System.currentTimeMillis());
    }

    public static void main(String[] args) {
        System.out.println(THREAD_LOCAL.get());
        System.out.println(getValue());
    }
}
